package com.bos.mapper;

import com.bos.data.model.AccessTokenModel;
import com.bos.data.model.BosCustomerModel;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

public interface WeiMapper {
    //1.增加操作
    @Insert("insert into AccessToken values(#{token},#{expiresIn},#{saveDate},#{type})")
    public int insertAccessToken(AccessTokenModel access);

    //2.查询出AccessToken中的值
    @Select("select * from AccessToken where type=#{type}")
    public List<AccessTokenModel> findAccessToken(String type);

    //3.根据type(accessToken类型) 去修改Access_token中的token 和saveDate
    @Update("update AccessToken set token=#{token},saveDate=#{saveDate} where type=#{type}")
    public int updateByExpirIn(AccessTokenModel acce);
    @Select("select * from Bos_customer where openId=#{openId}")
    public BosCustomerModel findByOpenId(String openId);
}
